TextPipe: Online Help
    Inserting data into a database
 

Submit feedback on this topic 

 Home  User Assistance   Tutorials   How to Use TextPipe
 Menus: File   Edit   Filters[ Convert   Add   Remove   Unicode   Replace   Special   Map   Email   Restrict ]  Tools   Window   Help   Advanced
Home
Up

 

 

Using TextPipe you can insert processed data directly into a database without having to run a second program.

The database filter assumes that incoming text is one or more SQL commands, each separated by a semi-colon. To insert data into a database, the text generally looks like this:

insert into products ( product_id, productname ) values ( 188875, 'AbusePipe Single User License' );
insert into products ( product_id, productname ) values ( 146467, 'Annual Renewal' );
insert into products ( product_id, productname ) values ( 139425, 'Annual Renewal (18%)' );

(This was created using a database filter set to generate a SQL Insert Script for table 'products', with Trial Run Input of 'select product_id,productname from products')

In the example above we are inserting into the 'products' table, into the fields product_id and productname.

Let's assume that our data is in CSV (Comma Separated Value) form:

188875,AbusePipe Single User License
146467,Annual Renewal
139425,Annual Renewal (18%)

We need to make some simple changes to it to manipulate it into the SQL Insert Script form.

  1. String fields usually need to be placed inside single or double quotes (depending on your database). This can be done using the Restrict to delimited fields (CSV, Tab, Pipe etc), with subfilters of an Add Header and Add Footer filter containing a single or double quote.

  2. Use an Add Left Margin filter with text of

    insert into products ( product_id, productname ) values (
     

  3. Use an Add Right Margin filter with text of

    );
     

  4. Add a database filter for the database the table is in.

Tutorial Index

 

 

 Contact Us   Support   Community   Tutorials and User Guides (online)
 © 1999-2005 Crystal Software. All rights reserved.